// run: $exec < input
// opt: 0
// flag: -g
#include <cstdio>

template <class T>
void scan(T & a)
{
	a = 0;
	bool flag = false;
	char ch = std::getchar();
	if (ch == '-')
		flag = true;
	else if (ch >= '0' && ch <= '9')
		a = ch - '0';

	while ((ch = std::getchar()) >= '0' && ch <= '9')
		a = a * 10 + ch - '0';
	if (flag) a = -a;
}
struct node
{
	int cover;
	int sum;
};

int const maxn = 101007;
node tree[10 * maxn];
int l[maxn], r[maxn], q[maxn];
int n, m;

void push_down(int id)
{
	if (tree[id].cover) {
		tree[id].sum |= tree[id].cover;
		tree[id * 2].cover |= tree[id].cover;
		tree[id * 2 + 1].cover |= tree[id].cover;
		tree[id].cover = 0;
	}
}

void push_up(int id)
{
	tree[id * 2].sum |= tree[id * 2].cover;
	tree[id * 2 + 1].sum |= tree[id * 2 + 1].cover;
	tree[id].sum = tree[id * 2].sum & tree[id * 2 + 1].sum;
}

void update(int id, int l, int r, int tl, int tr, int v)
{
	if (tl <= l && r <= tr) {
		tree[id].cover |= v;
		tree[id].sum |= v;
		return;
	}
	push_down(id);
	int mid = (l + r) / 2;
	if (tr <= mid) update(id * 2, l, mid, tl, tr, v);
	else if (tl > mid) update(id * 2 + 1, mid + 1, r, tl, tr, v);
	else {
		update(id * 2, l, mid, tl, tr, v);
		update(id * 2 + 1, mid + 1, r, tl, tr, v);
	}
	push_up(id);
}

int sum(int id, int l, int r, int tl, int tr)
{
	if (tl <= l && r <= tr) {
		return tree[id].sum | tree[id].cover;
	}
	push_down(id);
	int mid = (l + r) / 2;
	int ret = 0;
	if (tr <= mid) ret = sum(id * 2, l, mid, tl, tr);
	else if (tl > mid) ret = sum(id * 2 + 1, mid + 1, r, tl, tr);
	else {
		ret = sum(id * 2, l, mid, tl, tr) &
			sum(id * 2 + 1, mid + 1, r, tl, tr);
	}
	push_up(id);
	return ret;
}

bool check()
{
	for (int i = 0; i < m; i++) {
		if (sum(1, 1, n, l[i], r[i]) != q[i])
			return false;
	}
	return true;
}

int main()
{
	scan(n); scan(m);
	for (int i = 0; i < m; i++) {
		scan(l[i]); scan(r[i]); scan(q[i]);
		update(1, 1, n, l[i], r[i], q[i]);
	}
	if (check()) {
		std::printf("YES\n");
		for (int i = 1; i <= n; i++) {
			int ans = sum(1, 1, n, i, i);
			std::printf("%d ", ans);
		}
	} else {
		std::printf("NO\n");
	}
}

